<template>
  <div class="vx-title-bar">
    <div class="step-wrap">
      <div class="step-item" v-for="(item, index) in list" :key="index">
        <div :class="['step-circle', index + 1 < current ? 'active' : index + 1 == current ? 'current' : '']">{{ index + 1 }}</div>
        <p :class="[index + 1 < current ? 'active-p' : index + 1 == current ? 'current' : '']">{{ item }}</p>
        <div v-if="list.length != index + 1" class="active-nr">
          <img src="@/assets/image/common/arrowStep.png" />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'vx-title-bar',
  props: {
    list: {
      type: Array,
      default: () => {
        return ['录入信息', '确认信息', '提交结果'];
      },
    },
    current: {
      type: [String, Number],
      default: '1',
    },
  },
};
</script>
<style lang="scss">
.vx-title-bar {
  width: 100%;
  height: 90px;
  .step-wrap {
    height: 90px;
    display: flex;
    justify-content: center;
    .step-item {
      display: flex;
      align-items: center;
    }

    .step-circle {
      width: 26px;
      height: 26px;
      margin-right: 30px;
      line-height: 26px;
      text-align: center;
      color: #909399;
      font-size: 16px;
      border-radius: 50%;
      border: 2px solid #909399;
      &.current {
        color: #303133;
        border: 2px solid #303133;
      }
      &.active {
        color: #668ef1;
        border: 2px solid #668ef1;
      }
    }

    p {
      height: 20px;
      font-size: 14px;
      font-weight: 400;
      text-align: left;
      color: #999999;
      line-height: 20px;
      &.active-p {
        color: #668ef1;
      }
      &.current {
        color: #303133;
      }
    }
    .active-nr {
      height: 28px;
      font-size: 26px;
      color: #c0c4cc;
      border: 0;
      flex: 1;
      text-align: center;
      margin: 0 36px;
      img {
        width: 15px;
        height: 28px;
      }
    }
  }
}
</style>
